package com.mvu.banana.domain.stub;
import javax.persistence.ManyToOne;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import com.mvu.banana.domain.impl.KeyableBean;
import javax.persistence.Entity;

@Entity
public class Forum extends KeyableBean{

  @Length(min = 2, max = 30)
  @NotNull
  protected String name;

  @ManyToOne
  @NotNull
  protected Thread threads;

  public static final String NAME_PROP = "name";

  public static final String THREADS_PROP = "threads";

  public String getName(){
    return name;
  }

  public Forum setName(String p0){
    this.name = p0;
    return this;
  }

  public Thread getThreads(){
    return threads;
  }

  public Forum setThreads(Thread p0){
    this.threads = p0;
    return this;
  }

  public String toString(){
    StringBuilder builder = new StringBuilder();
    builder.append("name=").append(this.name).append(", ");
    builder.append("threads=").append(this.threads).append(", ");
    return builder.toString();
  }
}